-module('ex_6.1_indentation_spaces').

-include_lib("eunit/include/eunit.hrl").

-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").

single_test_() ->
    ?_assertMatch(
      {yamerl_parser,
        {file,?FILENAME},
        [],
        <<>>,
        301,
        true,
        [],
        0,
        302,
        13,
        1,
        false,
        12,
        33,
        utf8,
        false,
        undefined,
        _,
        _,
        [],
        {bcoll,root,0,-1,1,1,-1,1,1},
        false,
        false,
        false,
        [{impl_key,false,false,undefined,undefined,1,1}],
        false,
        false,
        _,
        [],
        0,
        27,
        26,
        undefined,
        undefined,
        _,
        false,
        [],
        [
          {yamerl_stream_end,12,33},
          {yamerl_doc_end,12,33},
          {yamerl_collection_end,12,33,block,mapping},
          {yamerl_collection_end,12,33,block,mapping},
          {yamerl_collection_end,12,5,flow,sequence},
          {yamerl_scalar,11,4,
            {yamerl_tag,11,4,{non_specific,"?"}},
            flow,plain,"Still by two"},
          {yamerl_sequence_entry,11,4},
          {yamerl_scalar,10,3,
            {yamerl_tag,10,3,{non_specific,"?"}},
            flow,plain,"Also by two"},
          {yamerl_sequence_entry,10,3},
          {yamerl_scalar,9,4,
            {yamerl_tag,9,4,{non_specific,"?"}},
            flow,plain,"By two"},
          {yamerl_sequence_entry,9,4},
          {yamerl_collection_start,8,14,
            {yamerl_tag,8,14,{non_specific,"?"}},
            flow,sequence},
          {yamerl_mapping_value,8,12},
          {yamerl_scalar,8,2,
            {yamerl_tag,8,2,{non_specific,"?"}},
            flow,plain,"Flow style"},
          {yamerl_mapping_key,8,2},
          {yamerl_scalar,5,16,
            {yamerl_tag,5,16,{non_specific,"!"}},
            block,literal,"By four\n  spaces\n"},
          {yamerl_mapping_value,5,14},
          {yamerl_scalar,5,2,
            {yamerl_tag,5,2,{non_specific,"?"}},
            flow,plain,"By one space"},
          {yamerl_mapping_key,5,2},
          {yamerl_collection_start,5,2,
            {yamerl_tag,5,2,{non_specific,"?"}},
            block,mapping},
          {yamerl_mapping_value,4,13},
          {yamerl_scalar,4,1,
            {yamerl_tag,4,1,{non_specific,"?"}},
            flow,plain,"Not indented"},
          {yamerl_mapping_key,4,1},
          {yamerl_collection_start,4,1,
            {yamerl_tag,4,1,{non_specific,"?"}},
            block,mapping},
          {yamerl_doc_start,4,1,{1,2},_},
          {yamerl_stream_start,1,1,utf8}
        ]
      },
      yamerl_parser:file(?FILENAME)
    ).
